package com.cn.sl.server.api.system.user.dao.rdb

import com.cn.sl.server.api.system.user.model.entity.AdminUserEntity
import com.cn.sl.server.api.system.user.repository.AdminUserRepository
import com.cn.sl.server.common.dao.BaseDao

/**
 * @author 阮雪峰
 */
interface AdminUserDao : BaseDao<AdminUserEntity, AdminUserRepository> {
    fun findAllByUsername(username: String): List<AdminUserEntity>
    fun findByUsername(username: String): AdminUserEntity?
    fun findByUsernameAndIdNot(username: String, id: Long): AdminUserEntity?
    fun findByDepartmentId(id: Long): List<AdminUserEntity>
    fun findByPhone(phone: String): AdminUserEntity?
    fun findByPhoneAndIdNot(phone: String, id: Long?): AdminUserEntity?
    fun findAllByDepartmentIdIn(departmentIds: List<Long>): List<AdminUserEntity>
    fun updatePassword(id: Long, password: String, salt: String)
}